package com.aerfafish.spider.neo4j.repository;

import com.aerfafish.spider.neo4j.dao.Date;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

/**
 * @author aerfafish
 * @date 2021/4/21 4:54 下午
 */
@Component
public interface DateRepository extends Neo4jRepository<Date, Long> {

    @Query("match (date:Date{date: $date} return date)")
    Date queryDate(@Param("date") String date);

    @Query("merge (date:Date{date: $date})")
    void save(@Param("date") String date);

}
